Cross validation for the ridge regression:
Cross validation for the ridge regression
Description
Cross validation for the ridge regression is performed using the TT estimate of bias (Tibshirani and Tibshirani, 2009).
There is an option for the GCV criterion which is automatic.
Usage
ridge.tune(y, x, M = 10, lambda = seq(0, 2, by = 0.1), mat = NULL,
ncores = 1, graph = FALSE)
Arguments
y
A numeric vector containing the values of the target variable. If the values are proportions or percentages,
i.e. strictly within 0 and 1 they are mapped into R using the logit transformation.
x
A numeric matrix containing the variables.
M
The number of folds. Set to 10 by default.
lambda
A vector with the a grid of values of $\lambda$ to be used.
mat
You can specify your own folds by giving a mat, where each column is a fold. Each column contains indices of the observations. You can also leave it NULL and it will create folds.
ncores
The number of cores to use. If it is more than 1 parallel computing is performed.
graph
If graph is set to TRUE the performances for each fold as a function of the $\lambda$ values will appear.
Value
A list including:
A list including:
Details
A k-fold cross validation is performed and the estimated performance is bias corrected as suggested by Tibshirani and Tibshirani (2009). This function is used by alfaridge.tune.
References
Hoerl A.E. and R.W. Kennard (1970). Ridge regression: Biased estimation for nonorthogonal problems. Technometrics, 12(1):55-67.
Brown P. J. (1994). Measurement, Regression and Calibration. Oxford Science Publications.
Tibshirani R.J., and Tibshirani R. (2009). A bias correction for the minimum error rate in cross-validation. The Annals of Applied Statistics 3(2): 822-829.